<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>叫什么标题呢</title>
     <script type="text/javascript" src="<{$public}>/js/jquery-1.8.3.min.js"></script>
	<script>
		$(function(){
			//单选框点击事件
			$("input[name='chrole']").click(function(){
				$("#mynu").empty();
			});
			
			//验证码框点击事件
			$("input[name='usercode']").click(function(){
				$("img").next().remove();
			});
		});
		
		//验证是否选择身份
		function docheck(){
			var dname=$("input[name='username']");
			var dpass=$("input[name='pass']");
			if(dname.val()==""){
					dname.nextAll().remove();
					dname.after('<span style="color:red;">名字不能为空</span>');
					return false;
				}
				if(dpass.val()==""){
					$("input[name='pass']").nextAll().remove();
					$("input[name='pass']").after('<span style="color:red;">密码不能为空</span>');
					return false;
				}
			if($(":checked").val()==null){
					//alert(dchrole.eq(2).val());
					$("mynu").empty();
					$("#mynu").append('<span style="color:red;">请选择身份</span>');
					return false;
				}
			return true;
		}
		
		
	</script>
	<style>
		input{
			border:1px solid #00b0f0;
			background:#ff00bb;
		}
	</style>
</head>
<body style="background:#00b0f0;">
	<div style="margin:100px 300px;">
		<form action="<{$url}>/prologin" method="post" onsubmit="return docheck()">
			<p>账&nbsp;&nbsp;号：<input type="text" name="username" value="<{$list.username}>"></p>
			<p>密&nbsp;&nbsp;码：<input type="password" name="pass"></p>
			<p style="font-size:12px">身份：<input type="radio" name="chrole" value="1">工作室
					 <input type="radio" name="chrole" value="2">学生
					 <input type="radio" name="chrole" value="3">发布者</p>
			<p id="mynu"></p>
			<p>验证码：<input size="10px" type="text" name="mycode">&nbsp;&nbsp;<img src="<{$url}>/getcode" onclick="this.src='<{$url}>/getcode/b/'+Math.random()"></p>
			 <p><span style="color:red;"><{$errorinfo}></span></p>
			<p><input type="submit" value="登录">&nbsp;&nbsp; <a href="<{$url}>/register">马上注册</a></p>
		</form>
	</div>
</body>
</html>
